<?php
namespace app\decorate\controller;
use app\AdminRest;
use think\App;
use think\Request;
use app\decorate\model\AdminEvaluate as eva_model;

class AdminEvaluate extends AdminRest{
    protected $model;
    public function __construct(App $app) {
        parent::__construct($app);
        $this->model = new eva_model();
    }
    /**
     * User: chenniang
     * Date: 2019-10-09 15:58
     * @return \think\Response
     * descption:评论列表
     */
    public function evaList(){
        $input = $this->_input;
        if(!empty($input['nickName'])){
            $dis[] = ['b.nickName','like',"%\\".$input['nickName']."%"];
        }
        $dis[] = ['a.uniacid','=',$this->_uniacid];
        $data  = $this->model->evaList($dis,$input['limit']);
        return $this->success($data);
    }
    /**
     * User: chenniang
     * Date: 2019-10-09 15:59
     * @return \think\Response
     * descption:编辑|回显评论
     */
    public function styleUpdate(){
        $input = $this->_input;
        if(count($input)>1){
            $data = $this->model->evaUpdate(['id'=>$input['id']],$input);
        }else{
            $data = $this->model->evaInfo(['a.id'=>$input['id']]);
        }
        return $this->success($data);
    }








}
